package com.ap.core.backoffice.domain;


import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDateTime;

import com.ap.core.common.types.MessageStatus;
import com.ap.core.cxf.jaxb.paymentdetails.TxnStatusType;
import com.ap.core.domain.AccountNumber;
import com.ap.core.domain.Amount;
import com.ap.core.domain.RollNumber;
import com.ap.core.domain.SortCode;






/**
 * User: Rohit.Dixit
 */
@Entity
@Table(name = "REFUND_VALID_AP_TRANSACTIONS")
@AttributeOverride(name = "id",column = @Column(name = "ap_txn_id"))
@TypeDef(name = "id", typeClass = String.class)
public class BackOfficeOrderPayment extends Identifiable<String> {

	private static final long serialVersionUID = 5180845106091590283L;

	@Column(name = "ap_txn_retrieval_id")
    private Long apTransactionRetrievalId;

    @Column(name = "RTP_ID")
    private String rtpId;

    @Column(name = "msg_id")
    private Long apMessageId;


    @Column(name = "DISTRIBUTOR_ID")
    private Long distributorId;

    @Column(name = "MERCHANT_ID")
    private Long merchantId;


    @Embedded
    @AttributeOverride(name = "value", column = @Column(name = "TOTAL_PAYMENT_REQUEST_AMOUNT"))
    private Amount totalPaymentRequestAmount;

    @Column(name = "CURRENCY_CODE")
    private String currencyCode;


    @Column(name = "STATUS_CODE")
    @Enumerated(EnumType.STRING)
    private MessageStatus statusCode;

    @Column(name = "last_update_tmstmp")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime lastUpdateTimestmp;


    @Column(name = "ZAPP_CONSUMER_ID")
    private Long zappConsumerId;

    @Column(name = "FI_ID")
    private Long fiId;
    
    
    @Column(name = "FI_CUSTOMER_ID")
    private String fiCustomerId;
    
    @Embedded
    @AttributeOverride(name = "rollNumber", column = @Column(name = "DEBIT_ROLL_NUMBER"))
    private RollNumber rollNumber;


    @Embedded
    @AttributeOverride(name = "accountNumber", column = @Column(name = "DEBIT_ACCOUNT_NUMBER"))
    private AccountNumber debitAccountNumber;

    @Embedded
    @AttributeOverride(name = "sortCode", column = @Column(name = "DEBIT_SORT_CODE"))
    private SortCode debitSortCode;

   
    @Column(name = "fps_status_code")
    @Enumerated(EnumType.STRING)
    private TxnStatusType transactionStatus;
       
	

    private BackOfficeOrderPayment(){}
    
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Long getApTransactionRetrievalId() {
		return apTransactionRetrievalId;
	}

	public String getRtpId() {
		return rtpId;
	}

	public Long getApMessageId() {
		return apMessageId;
	}

	public Long getDistributorId() {
		return distributorId;
	}

	public Long getMerchantId() {
		return merchantId;
	}

	public Amount getTotalPaymentRequestAmount() {
		return totalPaymentRequestAmount;
	}

	public String getCurrencyCode() {
		return currencyCode;
	}

	public LocalDateTime getLastUpdateTimestmp() {
		return lastUpdateTimestmp;
	}

	public Long getZappConsumerId() {
		return zappConsumerId;
	}

	public Long getFiId() {
		return fiId;
	}

	public String getFiCustomerId() {
		return fiCustomerId;
	}

	public RollNumber getRollNumber() {
		return rollNumber;
	}

	public AccountNumber getDebitAccountNumber() {
		return debitAccountNumber;
	}

	public SortCode getDebitSortCode() {
		return debitSortCode;
	}

	public TxnStatusType getTransactionStatus() {
		return transactionStatus;
	}

	public MessageStatus getStatusCode() {
		return statusCode;
	}
	
	

}
